let users = `向军电话: 12345678901
后盾人电话: 98765675603
`;

let reg = /(?<=\d{7})\d{4}/gi; // (?<=\d{7})这个表示断言，表示前面必须是7位数字所以就只剩下 4位数字了
users = users.replace(reg, (v) => {
  return "*".repeat(4);
});

console.log(users);

// 想要取出hdcms，后面不能跟数字，?!表示否定后面的表达式
let hd = "houdunren2010hdcms";
let reg1 = /[a-z]+(?!\d+)$/i; //这个$限制的是[a-z]
console.log(hd.match(reg1));

// 限定前面不是数字
let hd1 = "hdcms100houdunren";
let reg2 = /(?<!\d)[a-z]+/i; // 所以这会输出hdcms
console.log(hd1.match(reg2));

let o = [
  "https://www.houdunren.com/1.jpg",
  "https://oss.houdunren.com/2.jpg",
  "https://cdn.houdunren.com/3.jpg",
  "https://houdunren.com/4.jpg",
];

const reg3 = /https\/\/([a-z]+)?(?<!oss)\..+?(?=\/)/gi;
//过滤掉了https://oss.houdunren.com/2.jpg
